import { createApp } from 'vue'
import App from './App.vue'
import './index.css'
import 'amfe-flexible'

//引入路由
import router from './router'
import { createPinia } from 'pinia'
import piniaPersist from 'pinia-plugin-persist'
// 注意：这种方式将会导入所有组件
import NutUI from '@nutui/nutui'
// import { Icon } from '@nutui/nutui'
// 采用按需加载时  此全局css样式，需要删除
import '@/assets/scss/common.scss'
import '@nutui/nutui/dist/style.css'
import { permission, preventReClick } from '@/directives/permission'
import 'default-passive-events' //添加事件管理者'passive'，来阻止'touchstart'事件，让页面更加流畅。
import objCoppy from './utils/objCoppy'
//信息确定弹框
import myconfirm from './utils/myconfirm'
// import './permission'
import Chengxin from './chengxin/chengxin'

//查询钱包状态
let chengxWallet = Chengxin.getWalletStatusExport()
// chengxWallet.getWalletStatus()

//诚信支付
let chengxpay = Chengxin.getStartPayment()

//诚信提现
// let chengxWithdrawal = Chengxin.getToWithdrawExport()

//注册图标组件
// Object.keys(Icons).forEach((key) => {
// 	app.component(key, Icons[key as keyof typeof Icons])
// })

// h5调试控制台
// import Vconsole from 'vconsole'
// const vConsole = new Vconsole()

const pinia = createPinia()
//使用持久化插件
pinia.use(piniaPersist)
const app = createApp(App)
app.directive('permission', permission)
app.directive('preventReClick', preventReClick)
app.config.globalProperties.$objCoppy = objCoppy
app.config.globalProperties.$myconfirm = myconfirm
app.config.globalProperties.$cxpay = chengxpay
app.config.globalProperties.$cxWallet = chengxWallet
// app.config.globalProperties.$cxWithdrawal = chengxWithdrawal
/* window.Chengxin = Chengxin.Chengxin */
app.use(NutUI).use(pinia).use(router).mount('#app')

 

